var mongoose = require('mongoose');
// var uri = 'mongodb://localhost:27017/testmongo'; // 服务器
var uri = 'mongodb://111.231.55.237:27017/admin';
var db= mongoose.connect(uri);
var Schema = mongoose.Schema
var BlogPost = new Schema({
  username: String,
  password: String
})
var UserInfos = new Schema({
  username: String,
  url: String,
  nickname: String,
  roleId: Number,
  instroce: String
})
var ArticleInfos = new Schema({
  username: String,
  content: String,
  comment: Object,
  createOn: Date,
  modeifyOn: Date,
  title: String,
  isTop: Boolean,
  $inc: {
    articleId: Number
  },
})
const UserSchemal = mongoose.model('user', BlogPost)
const UserInfo = mongoose.model('userInfo', UserInfos)
const ArticleInfo = mongoose.model('article', ArticleInfos)

module.exports = {
  UserSchemal,
  UserInfo,
  ArticleInfo
}
